package com.example.springbootpro.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new JWTInterceptor()).addPathPatterns("/**").excludePathPatterns( // 排除不需要拦截的路径
            "/static/**",
                "/META-INF/resources/**",
                "/resources/**",
                 "/public/**",
                "/custom-static/**",
            "/resources/**",
            "/public/**",
            "/css/**",
            "/js/**",
            "/images/**",
            "/fonts/**",
            "/favicon.ico",
            "/**.html",
            "/**.css",
            "/**.js",
            "/**.jpg",
            "/**.png",
            "/**.gif",
            "/**.svg",
            "/**.ico",
            "/**.woff",
            "/**.woff2",
            "/**.ttf",
            "/**.map",
            "/**.mp4",
            "/**.webm",
                "/sys_users/login",  // 精确匹配登录路径
                "/sys_users/registry" // 精确匹配注册路径
    );
       }
}